/**
Company: Sarkar software technologys
WebSite: http://www.sarkar.cn
Author: yeganaaa
Date : 5/16/18
Time: 4:58 PM
 */

package Cn.Sarkar.IMS.Entities

import Cn.Sarkar.Entities.Common.BaseEntity
import Cn.Sarkar.Entities.IMS.IBuyTrade
import Cn.Sarkar.Entities.IMS.IBuyTradeItem
import Cn.Sarkar.Entities.IMS.IIMSApplicationDomain
import Cn.Sarkar.Entities.IMS.IProduct
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.hasOne
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.IDataContext
import Cn.Sarkar.IMS.DataBaseDefinations.BuyTradeItems

class BuyTradeItem(DataContext: IDataContext) : IBuyTradeItem, BaseEntity(DataContext, BuyTradeItems) {
    var applicationDomainID by BuyTradeItems.ApplicationDomainID
    override var applicationDomain: IIMSApplicationDomain by hasOne(BuyTradeItems.ApplicationDomainID) { IMSApplicationDomain(it) }
    var tradeID by BuyTradeItems.TradeID
    override var trade: IBuyTrade by hasOne(BuyTradeItems.TradeID) { BuyTrade(it) }
    var productID by BuyTradeItems.ProductID
    override var product: IProduct by hasOne(BuyTradeItems.ProductID) { Product(it) }
    override var number: Float by BuyTradeItems.Number
}